// 
//  FDGameMenuView.h
//  FiveDice
//  
//  Created by Chris Born.
//  Copyright 2007 Borngraphics. All rights reserved.
//  
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or any later version.
//  
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//  
//  By contributing code you grant Chris Born and Borngraphics an
//  unlimited, non-exclusive license to your contribution.
//  
//  For support, questions, commercial use, etc...
//  E-Mail: chris <at> borngraphics <dot> com
// 

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <UIKit/UIView.h>
#import <UIKit/UIView-UIImageViewImplementation.h>
#import <UIKit/UIView-Geometry.h>
#import <UIKit/UIControl.h>
#import <UIKit/UITextLabel.h>
#import <UIKit/UITransformAnimation.h>
#import <UIKit/UIAnimator.h>
#import <UIKit/UIPushButton.h>
#import "WebCore/WebFontCache.h"

#import <UIKit/UIKeyboard.h>

#import "common.h"
#import "FDHighScoresView.h"
#import "FDDefaultsController.h"
#import "FDTextInputView.h"

@interface NSObject (GameMenuDelegateMethods)

- (void)changeStateTo:(int)state;
- (void)showAboutAlert;
- (void)startNewGame;

@end

@interface FDGameMenuView : UIView
{
	struct CGRect				_contentRect;
	struct CGRect				_offScreenRect;
	struct CGRect				_onScreenRect;
	
	id	delegate;
	
	NSString	*playerOneName;
	NSString	*playerTwoName;
	
	UITransformAnimation	*translate;
	UIAnimator				*animator;
	
	FDDefaultsController	*defaults;
	FDHighScoresView		*highScoresView;
	UITextLabel				*playerOneLabel;	
	UITextLabel				*playerTwoLabel;	


	FDTextInputView			*textInputView;
	UIPushButton			*doneButton;
	
	BOOL	keyboardVisible;
	
}

-(id)initWithFrame:(struct CGRect)frame;

#pragma mark Show and Hide Methods
- (void)show;
- (void)hide;

#pragma mark Buttons and Graphics
- (void)setupButtons;

#pragma mark Other Views
- (void)showHighScoresBanner;
- (void)highScoreBannerDelayShow:(NSTimer *)aTimer;
- (void)hideHighScoresBanner;
- (void)sendClearHighScores;
- (void)showTextInputView:(UIPushButton *)button;

#pragma mark Delegates
- (void)buttonSelected:(UIPushButton *)button;
- (void)hidingHighScores;
- (void)updatedPlayerNames;

#pragma mark Accessors
- (BOOL)keyboardVisible;
- (void)setKeyboardVisible:(BOOL)newKeyboardVisible;
- (NSString *)playerOneName;
- (void)setPlayerOneName:(NSString *)newPlayerOneName;
- (NSString *)playerTwoName;
- (void)setPlayerTwoName:(NSString *)newPlayerTwoName;

#pragma mark Delegate
- (id)delegate;
- (void)setDelegate:(id)newDelegate;

#pragma mark Dealloc
- (void)dealloc;

@end